{% extends "base.html" %}
{% load markup %}

{% block title %}Welcome!{% endblock %}

{% block head %}
  <link rel="alternate" type="application/atom+xml" href="{% url news-feed %}" />
  <script type="text/javascript">
    $(function() {
      slideshow();
    });
  </script>
{% endblock %}


{% block body-attributes %} id="home"{% endblock %}

{% block header %}{% endblock %}

{% block headline %}
<div id="headline">
  <div id="headline-content">
    <div id="intro">
      <h2>{{ location.site.name }} connects people with information.</h2>
			<p>Find out who represents you in government, discover who funds their campaigns, and learn about how these contributions affect you and your community.</p>
      {% if no_address_match %}
      <p id="address-error">No match found for that address.  Please try another.</p>
      {% endif %}
      <form id="address-search" action="{% url reps %}">
        <label>Enter a Philadelphia Address</label>
        <input type="text" name="address" class="search-input" />
        <input type="submit" class="button" value="Search" />
      </form>
      <p class="sign-in"><a href="{% url auth_login %}">Sign in</a> or <a href="{% url registration_register %}">register</a> for extra features. {{ location.site.name }} is free.</p>
    </div>
    <div id="featured-stories">
      <span class="pre-title">Featured Content</span>
      <div class="content-slider">
        <div class="slides">
          <div class="slide-content"> 
            {% for content in featured_content %}
            <img src="{{ content.image.url }}" alt="{{ content.headline }}" class="slide-image {% ifequal forloop.counter 2 %}big{% else %}thumb{% endifequal %}" /> 
            {% endfor %}
          </div><!--end .slide-content-->
        </div><!--end .slides-->
      </div><!--end .content-slider-->
      <div class="slideshow-buttons"> 
        <a href="#" class="prev">prev</a> 
        <a href="#" class="next">next</a>
      </div>
      <ul id="featured-headlines">
        {% for content in featured_content %}
        <li><a href="{% url index %}{{ content.link }}">{{ content.headline }}</a></li>
        {% endfor %}
      </ul>
    </div><!--end .featured-headlines-->
  </div><!--end #headline-content-->
</div><!-- end #headline-->
{% endblock %}

{% block showcase %}
<div id="showcase" class="clearfix">
  <div class="column">
    <h3>Learn about your Reps</h3>
    <a href="{% url reps %}" title="Reps"><img src="{{ MEDIA_URL }}images/icon-reps-lg.gif"/></a>
    <p>Find out who represents you in local, state, and federal government, and also how to contact them. <a href="{% url reps %}"><strong>Reps &raquo;</strong></a></p>
  </div>
  <div class="column">
    <h3>Reports on local politics</h3>
    <a href="{% url reports %}" title="Reports"><img src="{{ MEDIA_URL }}images/icon-reports-lg.gif"/></a>
    <p>Read reports on local politics and access data downloads detailing spending and voting.  <a href="{% url reports %}"><strong>View Reports &raquo;</strong></a></p>
    </div>
  <div class="column">
    <h3>Info on Relevant Issues</h3>
    <a href="{% url issues %}" title="Issues"><img src="{{ MEDIA_URL }}images/icon-issues-lg.gif"/></a>
    <p>Learn more about the issues concerning you, your community, and your local government. <a href="{% url issues %}"><strong>View Issues &raquo;</strong></a></p>
  </div>
  <div class="column">
    <h3>Follow our blog</h3>
    <a href="{% url blog %}" title="Blog"><img src="{{ MEDIA_URL }}images/icon-blog-lg.gif"/></a>
    <p>Follow news and discussion about {{ location.site.name }}, your community, and local politics. <a href="{% url blog %}"><strong>View our blog &raquo;</strong></a></p>
  </div>
</div><!-- end #showcase-->
{% endblock %}

{% block primary-content %}
  <h3>{{ location.site.name }} helps people access the information and resources necessary in creating an open, honest, and accountable local government that serves the public interest.</h3>
  <p class="site-intro">{{ location.site.name }} is a community website designed to both provide information to Philadelphians about the role of money in local politics and allow users to investigate these issues for themselves. A project of Common Cause PA made possible by the Samuel S. Fels Fund, {{ location.site.name }} highlights the role of campaign contributions to your elected representatives in the creation of policy that affects local residents. <a href="{% url reps %}">Get Started &raquo;</a></p>
  <div class="two-columns">
    <div class="column">
      {% if featured_report %}
      <span class="pre-title report">Featured Report</span>
      <h4><a href="{% url report featured_report.id %}">{{ featured_report.title }}</a></h4>
      <small class="date-posted">Posted {{ featured_report.pub_date|date }}</small>
      {{ featured_report.synopsis|markdown|truncatewords_html:50 }}
      <p class="read-more"><a href="{% url report featured_report.id %}">Read the full report &raquo;</a></p>
      {% endif %}
    </div>
    <div class="column">
      {% if from_our_blog %}
      <span class="pre-title from-blog">From our Blog</span>
      <h4><a href="{% url blog_post from_our_blog.id %}">{{ from_our_blog }}</a></h4>
      <small class="date-posted">Posted {{ from_our_blog.pub_date|date }}</small>
      {{ from_our_blog.body|markdown|truncatewords_html:50 }}
      <p class="read-more"><a href="{% url blog_post from_our_blog.id %}">Read the full post &raquo;</a></p>
      {% endif %}
    </div>
  </div>  
  <div class="two-columns">
    <div class="column">
      <span class="pre-title starred">Featured User Comment</span>
      <blockquote class="framed">
        {{ featured_comment.comment|markdown|truncatewords_html:20 }}
        <p><a href="{% url blog_post featured_comment.content_object.id %}#{{ featured_comment.id }}">Read more &raquo;</a></p>
      </blockquote>
      <cite class="quote-credit">{{ featured_comment.user_name }}</cite>
      <small class="date-posted date-quoted">Posted {{ featured_comment.submit_date|date }}</small>
    </div>
    <div class="column">
      <span class="pre-title issues">Featured Issue</span>
      <h4><a href="{% url issues %}#{{ featured_issue.slug }}">{{ featured_issue.name }}</a></h4>
      {{ featured_issue.description|markdown|truncatewords_html:50 }}
      <p class="read-more"><a href="{% url issues %}#{{ featured_issue.slug }}">Read more about this issue &raquo;</a></p>
    </div>    
  </div>
{% endblock %}
